<html lang="zh-CN">

<head> {% load bootstrap4 %} {% bootstrap_css %} {% bootstrap_javascript %}
    <title>产品自动化测试平台</title>
    <link rel="stylesheet" type="text/css" href="/static/admin/css/forms.css" />
    <script type="text/javascript" src="/admin/jsi18n/"></script>
    <script type="text/javascript" src="/static/admin/js/vendor/jquery/jquery.js"></script>
    <script type="text/javascript" src="/static/admin/js/jquery.init.js"></script>
    <script type="text/javascript" src="/static/admin/js/core.js"></script>
    <script type="text/javascript" src="/static/admin/js/admin/RelatedObjectLookups.js"></script>
    <script type="text/javascript" src="/static/admin/js/actions.js"></script>
    <script type="text/javascript" src="/static/admin/js/urlify.js"></script>
    <script type="text/javascript" src="/static/admin/js/prepopulate.js"></script>
    <script type="text/javascript" src="/static/admin/js/vendor/xregexp/xregexp.js"></script>
    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum- scale=1.0">
    <link rel="stylesheet" type="text/css" href="/static/admin/css/responsive.css" />
    <meta name="robots" content="NONE,NOARCHIVE" />

</head>

<body role="document">



    <!—设置列表-->
    <div class="row" style="padding-top: 70px;">
        <!-- 导航栏-->
    <nav class="navbar navbar-expand-sm bg-dark navbar-dark fixed-top">
        <div class="container"> <a class="navbar-brand" href="#">&nbsp;</a>
            <ul class="nav justify-content-center"> </ul>
            <ul class="nav justify-content-end">
                <li class="nav-link"><a style='color:white' href="#">{{user}}</a></li>
                <li class="nav-link"><a style='color:white' href="/logout/">退出</a></li>
            </ul>
        </div>
    </nav>

    <!-- 搜索栏 -->
        <div class="page-header" style="padding-left: 20px;">
            <form class="navbar-form" method="get" action="/setsearch/">
                {% csrf_token %}
                <input type="search" name="setname" placeholder="名称" required>
                <button type="submit">搜索</button>
            </form>
        </div>
        <!-- 增加系统设置-->
        <div style="float:right;width:73%">
            <select name="Set" id="id_Set">
                <option value="" selected>----设置名称----</option>
            </select>
            <a class="related-widget-wrapper-link change-related" id="change_id_Set" data-href- template="/admin/set/set/ fk /change/?_to_field=id&amp;_popup=1" title="更改选中的系统设置">
                <img src="/static/admin/img/icon-changelink.svg" alt="修改" />
            </a>
            <a class="related-widget-wrapper-link add-related" id="add_id_Set" href="/admin/set/set/add/?_to_field=id&amp;_popup=1" title="增加另一个系统设置">
                <img src="/static/admin/img/icon-addlink.svg" alt="增加" />增加
            </a>
        </div>

        <div class="col-md-11">
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>设置名称</th>
                        <th>设置的值</th>
                        <th>编辑</th>
                        <th>删除</th>
                    </tr>
                </thead>
                <tbody> {% for set in sets %} <tr>
                        <td>{{ set.id }}</td>
                        <td>{{ set.setname }}</td>
                        <td>{{ set.setvalue }}</td>
                        <td><a style='color:light blue' class="related-widget-wrapper-link add-related" id="add_id_Set" href="../admin/set/set/{{ set.id}}/change/?_to_field=id&_popup=1"><img src="/static/admin/img/icon-changelink.svg"/></a></td>
                        <td><a style='color:light blue' class="related-widget-wrapper-link add-related" id="add_id_Set" href="../admin/set/set/{{ set.id	}}/delete/?_to_field=id&_popup=1"><img src="/static/admin/img/icon- deletelink.svg"/></a></td>

                    </tr> {% endfor %} </tbody>
            </table>
        </div>
    </div>

<!--统计和翻页功能-->
<span style="position:absolute; right:100px; bottom:30px;"> {# 把翻页功能固定显示在右下角#}
    <div class="container">
        <ul class="pagination" id="pager">
            {# 上一页链接开始#}
            {% if sets.has_previous %}
            {# 如果有上一页，则正常显示上一页的链接#}
            <li class="previous"><a href="/set_manage/?page={{ sets.previous_page_number }}">上一页
                </a></li> {# 上一页标签 #}
            {% else %}
            <li class="previous disabled"><a href="#">上一页</a></li> {# 如果当前不存在上一页，则上一页的链接不可单击#}
            {% endif %}
            {# 上一页链接开始#}
            {% for num in sets.paginator.page_range %}
            {% if num == currentPage %}
            <li class="item active"><a href="/set_manage/?page={{ num }}">{{ num }}</a></li> {#显示当前页数链接#}
            {% else %}
            <li class="item"><a href="/set_manage/?page={{ num }}">{{ num }}</a></li>
            {% endif %}
            {% endfor %}
            {# 下一页链接开始#}
            {% if sets.has_next %} {# 如果有下一页则正常显示下一页的链接#}
            <li class="next"><a href="/set_manage/?page={{ sets.next_page_number }}">下一页</a></li>
            {% else %}
            <li class="next disabled"><a href="#">下一页</a></li>
            {% endif %}
            {# 下一页链接结束#}
        </ul>
    </div>
</span>
</body>

</html>